<template>
  <div>
    <h2>组件传值</h2>
    <!-- 使用组件 -->
    <!-- 如果给子组件传递数据，则通过自定义属性的方式传递 -->
    <GoodsList :uname="username" :age="age" sex="男"></GoodsList>
    <GoodsList :uname="username" :age="age" ></GoodsList>
    <GoodsList :uname="username" :age="age" ></GoodsList>

  </div>
</template>

<script>
//导入组件
import GoodsList from "@/components/GoodsList.vue";

export default {
  data() {
    return {
      username: "lisi",
      age: 20,
    };
  },
  //注册组件
  components: {
    GoodsList,
  },
};
</script>

<style>
</style>